package top.kaoshanji.r7ch14a;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import top.kaoshanji.r7ch14a.domain.Forum;

/**
 * @author kaoshanji
 * ^_^
 * create time 2025/5/12 14:09
 */
@Repository
public class ForumMybatisTemplateDao {

    @Autowired
    private SqlSessionTemplate sqlSessionTemplate;

    public Forum getForum(int forumId) {
        return sqlSessionTemplate.selectOne("top.kaoshanji.r7ch14a.dao.ForumDao.getForum", forumId);
    }

    public int getForumNum() {
        return sqlSessionTemplate.selectOne("top.kaoshanji.r7ch14a.dao.ForumDao.getForumNum");
    }

}
